<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			function load(){
				let c = document.getElementById('myC');
				let ctx = c.getContext('2d');

				ctx.fillStyle="#000";
				ctx.fillRect(0,0,300,300);
				ctx.fill();

				// 裁切
				ctx.beginPath();
				ctx.arc(150,150,130,0,Math.PI*2,true);
				ctx.clip();

				ctx.translate(200,20);
				for(let i=1; i<80; i++){
					ctx.translate(30,30);
					ctx.scale(0.95,0.95);
					ctx.rotate(Math.PI/12);

					ctx.beginPath();
					ctx.fillStyle="#F00";
					ctx.globalAlpha="0.4";
					ctx.arc(0,0,50,0,Math.PI*2,true);
					ctx.closePath();
					ctx.fill();
				}
			}

			window.onload = function(){
				load();
			}
		</script>
	</head>
	<body>
		<canvas id="myC" style="border: 1px #000 solid;" width="800" height="450">
			你的浏览器不支持canvas元素！
		</canvas>
	<div><script language="javascript">

	</script></div></body>
</html>
